package  net.libra.ui.base
{
	import flash.display.DisplayObjectContainer;
	
	import net.libra.ui.event.ItemEvent;
	
	public class ItemRenderer extends BaseSprite
	{
		public function ItemRenderer(skin:DisplayObjectContainer)
		{
			super();
			this.addChild(skin);
			x = skin.x;
			y = skin.y;
		}

		public function init():void
		{
			
		}
		
		private var _index:int=-1;
		public function get index():int
		{
			return _index;
		}
		
		public function set index(value:int):void
		{
			_index = value;
		}
		
		
		private var _selected:Boolean;
		public function get selected():Boolean
		{
			return _selected;
		}
		public function set selected(value:Boolean):void
		{
			_selected = value;
			if(_selected == true)
			{
				dispatchEvent(new ItemEvent(ItemEvent.SELECTED_CHANGE,data));
			}
		}
	}
}